package net.sxnic.jhitem.itempeople.dao;

import java.util.List;

import net.sxnic.jhitem.itempeople.ItemPeople;
import net.sxnic.jhitem.itempeople.dao.ItemPeopleDao;
import net.sxinfo.core.spring25.HibernateDao;

import org.springframework.stereotype.Repository;

@Repository("itemPeopleDao")
public class HibernateItemPeopleDao extends HibernateDao<ItemPeople, String> implements
	ItemPeopleDao {

	/**
	 * @Description: 根据主表id查询项目主要参加人员表
	 * @param baseinfoId 主表id
	 * @return 项目主要参加人员list
	 */
	public List<ItemPeople> findListByBaseinfoId(String baseinfoId)
	{
		String hql="from ItemPeople where baseinfoId= ? order by peopleOrder";
		return  find(hql, new Object[]{baseinfoId});
	}
	
	/**
	 * 根据主表ID查询国内参加人员
	 * @param baseinfoId 主表Id
	 * @return 国内参加人员List
	 */
	public List<ItemPeople> findGnList(String baseinfoId)
	{
		String hql = "from ItemPeople where baseinfoId=? and country in ('001','006','005') order by peopleOrder)";
		return find(hql,new Object[]{baseinfoId});
	}
	
	/**
	 * 根据主表ID查询国外参加人员
	 * @param baseinfoId 主表Id
	 * @return 国外参加人员List
	 */
	public List<ItemPeople> findGwList(String baseinfoId)
	{
		String hql = "from ItemPeople where baseinfoId=? and country not in ('001','006','005') order by peopleOrder)";
		return find(hql,new Object[]{baseinfoId});
	}
}
